package com.zlj.jdbc.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 1、希望在一个servlet中可以有多个请求处理方法；
 * 2、客户端发送请求时，必须多给出一个参数，用来说明要调用的方法；
 *   请求处理方法的签名必须与service相同，即返回值和参数以及声明的异常都相同！
 * 3、客户端必须传递名为method的参数！
 * 
 * 请求处理方法：除了名称以外，都与service方法相同。
 * @author bashen
 */
@WebServlet("/AServlet")
public class AServlet extends BaseServlet {

	public void addUser(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	    System.out.println("addUser()....");
	    throw new IOException("测试方法内部出现了异常！");
	}

	public void editUser(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		System.out.println("editUser()....");
	}
	
	public void deleteUser(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		System.out.println("deleteUser()....");
	}
	
    public void findAll(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    	System.out.println("findAll()....");
	}
}
